﻿using UnityEngine;
using System.Collections.Generic;
namespace Room
{
    public class RoomLODManager
    {

        private RoomBase room;

        public void Init(RoomBase room)
        {
            this.room = room;

            room.charactorManager.onCharactorStartCallback += OnCharactorStart;

        }



        public virtual void OnCharactorStart(RoomCharactor charactor)
        {
            if(charactor.type==CharactorType.OtherPlayer)
            {
                if(room.GetSceneType()== SceneType.TOWN)
                {
                    charactor.SetLodLevel((int)LODLevel.Medium);
                }
                else
                {
                    charactor.SetLodLevel((int)LODLevel.High);
                }
            }
            else
            {
                charactor.SetLodLevel((int)LODLevel.High);
            }
        }


    }
}
